package year2019.month11.singleton;

/**
 * @desc 单例模式：饿汉模式
 * create on 2018/11/6 by watson
 */
public class EagerSingleton {
    private static EagerSingleton eagerSingleton = new EagerSingleton();

    private String str = "str123";

    private EagerSingleton(){}

    public String getStr() {
        return str;
    }

    public void setStr(String str) {
        this.str = str;
    }

    public static EagerSingleton getEagerSingleton() {
        return eagerSingleton;
    }

}
